package.path = package.path .. ";./../../llib/?.lua";
--require("drw")
--require("toArray");
require("toType");
print(require("lSDL"));

rect = cast(SDL_Rect());
rect.y = 20;

print(rect.x);


set__gc(rect,function(a)
    print("gc",a);
    SDL_free(a);
end);

print(rect.y);

local event = SDL_calloc(0x100,1);
event = cast(event,"SDL_Event");

event.type = 20;
print("type     :",event.type);
print("point    :",dint(event));
key = event.key;
print("key point:",dint(key));

keysym = key.keysym;
print("key type:",dint(keysym));
print("scancode:",dint(keysym.scancode));

print("xxx     :",event.key.keysym.scancode);

SDL_free(event);

local palette = SDL_calloc(0x100,1);
palette = cast(event,"SDL_Palette");
print("pointer :",dint(palette.colors));
print("pointer :",dint(palette.colors[0]));
print("pointer :",dint(palette.colors[1]));
print("pointer :",dint(palette.colors[2]));




